#!/bin/bash
CONTAINER_NAME=zookeeper

# 删除容器
if docker ps -a | grep $CONTAINER_NAME | awk '{print $1 }' ; then
    docker rm -f $CONTAINER_NAME
fi


docker run -d \
    --name $CONTAINER_NAME \
    -p 2181:2181 \
    wurstmeister/zookeeper

# logs
docker logs -f $CONTAINER_NAME